
let vm=new Vue({
    el:'#app',
    data:{
        etoday:' ',
        emonth:' ',
        etotal:' ',
        remissions:' ',
        ptrees:' ',
        datas:[]
    },
    mounted:function(){
        this.showData();
        this.showPower();
    },
    methods:{
        showData:function () {
            $.ajax({
                type: 'GET',
                url: "./json/powerData.json",
                // data:{type:type,ext:ext},
                dataType: "json",
                success: function (result) {
                    vm.etoday=result.etoday;
                    vm.emonth=result.emonth;
                    vm.etotal=result.etotal;
                    vm.remissions=result.remissions;
                    vm.ptrees=result.ptrees;
                }
            })
        },
        showPower:function () {
            jQuery.ajax({
                type: 'Get',
                url: "./json/efficacy.json",
                datatype: "json",
                success: function (data) {
                    let pefficacyData=[];
                    for (let i = 0; i < data.length; i++) {
                        vm.datas.push(data[i]);
                        pefficacyData[i]=data[i].pefficacy;
                    }
                    pefficacyMax = Math.max.apply(Math,pefficacyData);
                    console.log(pefficacyMax)
                },
            });
        }
    }
});


